import request from "@/utils/request"
import apiConfig from "@/utils/apiConfig"
const { videoList, videoAdd, videoInfo, videoUpdate,delVideoItem } = apiConfig.api

export default class News {
    static getVideoList(apiData = {}) {
        return request(videoList, apiData, 'post').then((result) => {
            return result.data || {}
        })
    };
    static addVideo(apiData = {}) {
        return request(videoAdd, apiData, 'post').then((result) => {
            return result.data || {}
        })
    }
    static updateVideo(id, apiData = {}) {
        apiData.id = id
        return request(videoUpdate, apiData, 'post').then((result) => {
            return result.data || {}
        })
    }
    static getVideoInfo(id, apiData = {}) {
        return request(`${videoInfo}/${id}`, apiData, 'get').then((result) => {
            return result.data || {}
        })
    }
    static delVideoItem(apiData = {}) {
        return request(`${delVideoItem}`, apiData, 'delete').then((result) => {
            return result.data || {}
        })
    }
}